package com.demo.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;

public class ActionInvInterceptor implements Interceptor {

	@Override
	public void intercept(ActionInvocation ai) {
		ai.invoke();
		System.out.println("controllerKey:ai.getControllerKey() = "+ ai.getControllerKey());
		System.out.println("actionKey:ai.getActionKey() = "+ ai.getActionKey());
		System.out.println("methodName:ai.getMethodName() = "+ ai.getMethodName());
		System.out.println("viewPath:ai.getViewPath() = "+ ai.getViewPath());
//		ai.getController().renderText("ActionInvInterceptor测试结果:\ncontrollerKey:ai.getControllerKey() = "+ ai.getControllerKey()+"\nactionKey:ai.getActionKey() = "+ ai.getActionKey()
//				+"\nmethodName:ai.getMethodName() = "+ ai.getMethodName()+"\nviewPath:ai.getViewPath() = "+ ai.getViewPath());
		ai.getController().redirect("/param");
	}

}
